hysop.operator.spatial_filtering module

@file advection.py RestrictionFilter operator generator.

class hysop.operator.spatial_filtering.InterpolationFilterFrontend(input_variable, output_variable, filtering_method, implementation=None, base_kwds=None, **kwds)[source]

Bases: SpatialFilterFrontend

Interface for interpolation filtering: coarse grid -> fine grid Available implementations are:

*Python using polynomials (linear, cubic, quintic, …)

Initialize a SpatialFilter operator.

Parameters:
  • input_variable (ScalarField) – Input field as a tuple (ScalarField, CartesianTopologyDescriptor).

  • output_variable (ScalarField) – Output field as a tuple (ScalarField, CartesianTopologyDescriptor).

  • filtering_method (FilteringMethod) – Specify the lowpass filter type (either spectral or with remeshing kernels).

  • implementation (implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • kwds – Extra parameters passed to generated operator.

Notes

An implementation should at least support the SpatialFilterBase interface.

classmethod all_default_implementations()[source]

Return the default Implementation for each method. The return type is a dictionnary (method -> default_implementation).

classmethod all_implementations()[source]

Return all implementations of a certain method as a dictionnary. Keys are the methods and values are dictionnaries of (implementation -> operator).

class hysop.operator.spatial_filtering.RestrictionFilterFrontend(input_variable, output_variable, filtering_method, implementation=None, base_kwds=None, **kwds)[source]

Bases: SpatialFilterFrontend

Interface for restriction filtering: fine grid -> coarse grid Available implementations are:

*Python/OpenCL using spectral filtering *Python using remeshing kernels *Python by just taking a subgrid (compatibility with deprecated MultiresolutionFilter)

Initialize a SpatialFilter operator.

Parameters:
  • input_variable (ScalarField) – Input field as a tuple (ScalarField, CartesianTopologyDescriptor).

  • output_variable (ScalarField) – Output field as a tuple (ScalarField, CartesianTopologyDescriptor).

  • filtering_method (FilteringMethod) – Specify the lowpass filter type (either spectral or with remeshing kernels).

  • implementation (implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • kwds – Extra parameters passed to generated operator.

Notes

An implementation should at least support the SpatialFilterBase interface.

classmethod all_default_implementations()[source]

Return the default Implementation for each method. The return type is a dictionnary (method -> default_implementation).

classmethod all_implementations()[source]

Return all implementations of a certain method as a dictionnary. Keys are the methods and values are dictionnaries of (implementation -> operator).

class hysop.operator.spatial_filtering.SpatialFilter(input_variables, output_variables, filtering_method, implementation=None, base_kwds=None, **kwds)[source]

Bases: ComputationalGraphNodeGenerator

Graphnode generator to generate interpolation or restriction filter for multiple fields at once.

Initialize a RestrictionFilter/InterpolationFilter operator generator.

Parameters:
  • intput_variables (dict) – Input fields on fine grid. Dictionary of continuous fields as keys and topologies as values.

  • output_variables (dict) – Output fields on coarse grid, default to input_fields. Dictionary of continuous fields as keys and topologies as values.

  • filtering_method (FilteringMethod) – Specify the lowpass filter type (either spectral or with remeshing kernels).

  • implementation (implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • kwds – Extra parameters passed to generated operators.

class hysop.operator.spatial_filtering.SpatialFilterFrontend(input_variable, output_variable, filtering_method, implementation=None, base_kwds=None, **kwds)[source]

Bases: MultiComputationalGraphNodeFrontend

Initialize a SpatialFilter operator.

Parameters:
  • input_variable (ScalarField) – Input field as a tuple (ScalarField, CartesianTopologyDescriptor).

  • output_variable (ScalarField) – Output field as a tuple (ScalarField, CartesianTopologyDescriptor).

  • filtering_method (FilteringMethod) – Specify the lowpass filter type (either spectral or with remeshing kernels).

  • implementation (implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • kwds – Extra parameters passed to generated operator.

Notes

An implementation should at least support the SpatialFilterBase interface.